package com.ethink.order.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.order.api.info.GroupMateInfo;
import com.ethink.order.common.entity.GroupMate;

/**
 * 组套商品表 Converter转换器
 *
 * @author default
 * @date 2023-02-22
 */
@Component
public class GroupMateConverter implements Converter<GroupMateInfo, GroupMate> {

    @Override
    public GroupMate convertTo(GroupMateInfo info) {
        if(info == null) {
            return null;
        }
        GroupMate entity = new GroupMate ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public GroupMateInfo convertFrom(GroupMate entity) {
        if(entity == null) {
            return null;
        }
        GroupMateInfo info = new GroupMateInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
